//
//  WmcPhotographStatisticsModel.swift
//  YPWatermarkCamera
//
//  Created by 周诗松 on 2022/5/23.
//

import Foundation

struct WmcPhotographStatisticsModel: YPNetworkJsonProtocol {
    /// 年
    var year: Int = 0

    /// 月
    var month: Int = 0

    /// 日
    var day: Int = 0

    /// 照片张数
    var count: Int = 0

    mutating func mapping(mapper: HelpingMapper) {
        mapper <<< self.year <-- "y"
        mapper <<< self.month <-- "m"
        mapper <<< self.day <-- "d"
        mapper <<< self.count <-- "num"
    }
    
    func date() -> Date {
        let dateStr = self.dateStr()
        return dateStr.yp.date ?? Date()
    }
    
    func dateStr() -> String {
        let str = "\(year)-\(month)-\(day)"
        return str
    }
}
